package com.jzlin.alltools.service.chatai.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 消息所属角色
 */
@Getter
@AllArgsConstructor
public enum ChatAiMessageRole {
    SYSTEM("system"),
    USER("user"),
    ASSISTANT("assistant"),
    FUNCTION("function"),
    UNKNOWN("UNKNOWN");

    private final String value;

    public static ChatAiMessageRole of(String roleValue) {
        for(ChatAiMessageRole role : values()) {
            if (role.value.equals(roleValue)) {
                return role;
            }
        }
        return UNKNOWN;
    }
}
